package com.redoor.iot.controller;

import java.io.IOException;

import org.springframework.stereotype.Controller;

import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.redoor.iot.model.User;
import com.redoor.iot.utils.SessionUtil;



@Controller
public class BaseController {
	public User getUser() throws JsonParseException, JsonMappingException, IOException {
		return SessionUtil.getUser();
	}

	public Long getUserId() throws JsonParseException, JsonMappingException, IOException {
		return getUser().getUserId();
	}

	public String getUserName() throws JsonParseException, JsonMappingException, IOException {
		return getUser().getUserName();
	}
}